#!/usr/local/bin/perl -w
use strict;
use DBI;
my $dbh = DBI->connect(
  "dbi:Gigabase:","guest", "guest",{AutoCommit=>1,RaiseError=>1});

my $insert=$dbh->prepare(q{
  insert into person (name,address,salary,rating) values (?,?,?,?)
 });
 $insert->execute("John Smith","1 Guildhall St., Cambridge CB2 3NH, UK",
     80000,3.84);

my $by_name=$dbh->prepare('select from person where name = ?');
my $by_oid=$dbh->prepare('select from person where current = ?');

# via name
my $rows=$by_name->execute('John Smith');
my($a,$b,$c,$d)=$by_name->fetchrow_array;
my $oid=$by_name->{gbase_oid};
print "#",$oid," $a, $b, $c, $d\n";
# via gigabase instanse reference
$by_oid->execute($oid);
print "#",$oid," $a, $b, $c, $d\n";
$dbh->disconnect;
